package org.sunflower.elastic;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-10-14 13:44
 **/
@Document(indexName = "user")
@Data
public class User {
    @Id
    private String id;
    @Field
    private String username;
    @Field
    private Integer age;

    public User(String id, String username, Integer age) {
        this.id = id;
        this.username = username;
        this.age = age;
    }
}
